<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The RecursiveArrayIterator class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="parentiterator.rewind.html">ParentIterator::rewind</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="recursivearrayiterator.getchildren.html">RecursiveArrayIterator::getChildren</a></div>
 <div class="up"><a href="spl.iterators.html">迭代器</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.recursivearrayiterator" class="reference">
 <h1 class="title">The RecursiveArrayIterator class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.1.0)</p>


  <div class="section" id="recursivearrayiterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    This iterator allows to unset and modify values and keys while iterating over Arrays and Objects
    in the same way as the <span class="type"><a href="class.arrayiterator.html" class="type ArrayIterator">ArrayIterator</a></span>. Additionally it is possible to iterate
    over the current iterator entry.
   </p>
  </div>


  <div class="section" id="recursivearrayiterator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">RecursiveArrayIterator</strong>
     </span>

     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.arrayiterator.html" class="classname">ArrayIterator</a>
     </span>

     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.recursiveiterator.html" class="interfacename">RecursiveIterator</a></span>
     </span>

     {</div>


    

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">RecursiveArrayIterator</span><span class="methodname"><a href="recursivearrayiterator.getchildren.html" class="methodname">getChildren</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="recursivearrayiterator.haschildren.html" class="methodname">hasChildren</a></span>
    ( <span class="methodparam">void</span>
   )</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherits */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.append.html" class="methodname">ArrayIterator::append</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.asort.html" class="methodname">ArrayIterator::asort</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="arrayiterator.construct.html" class="methodname">ArrayIterator::__construct</a></span>
    ([ <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$array</code><span class="initializer"> = array()</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="arrayiterator.count.html" class="methodname">ArrayIterator::count</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="arrayiterator.current.html" class="methodname">ArrayIterator::current</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="arrayiterator.getarraycopy.html" class="methodname">ArrayIterator::getArrayCopy</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.getflags.html" class="methodname">ArrayIterator::getFlags</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="arrayiterator.key.html" class="methodname">ArrayIterator::key</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.ksort.html" class="methodname">ArrayIterator::ksort</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.natcasesort.html" class="methodname">ArrayIterator::natcasesort</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.natsort.html" class="methodname">ArrayIterator::natsort</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.next.html" class="methodname">ArrayIterator::next</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.offsetexists.html" class="methodname">ArrayIterator::offsetExists</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$index</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="arrayiterator.offsetget.html" class="methodname">ArrayIterator::offsetGet</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$index</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.offsetset.html" class="methodname">ArrayIterator::offsetSet</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$index</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$newval</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.offsetunset.html" class="methodname">ArrayIterator::offsetUnset</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$index</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.rewind.html" class="methodname">ArrayIterator::rewind</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.seek.html" class="methodname">ArrayIterator::seek</a></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$position</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="arrayiterator.serialize.html" class="methodname">ArrayIterator::serialize</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.setflags.html" class="methodname">ArrayIterator::setFlags</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$flags</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.uasort.html" class="methodname">ArrayIterator::uasort</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cmp_function</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="arrayiterator.uksort.html" class="methodname">ArrayIterator::uksort</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cmp_function</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="arrayiterator.unserialize.html" class="methodname">ArrayIterator::unserialize</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$serialized</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="arrayiterator.valid.html" class="methodname">ArrayIterator::valid</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>

  </div>



 </div>

 













<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="recursivearrayiterator.getchildren.html">RecursiveArrayIterator::getChildren</a> — Returns an iterator for the current entry if it is an array or an object.</li><li><a href="recursivearrayiterator.haschildren.html">RecursiveArrayIterator::hasChildren</a> — Returns whether current entry is an array or an object.</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="parentiterator.rewind.html">ParentIterator::rewind</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="recursivearrayiterator.getchildren.html">RecursiveArrayIterator::getChildren</a></div>
 <div class="up"><a href="spl.iterators.html">迭代器</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
